var querystring = require('querystring');

function show(request, response) {
    var postData = '';
    request.addListener('data', chunk => postData += chunk);
    request.addListener('end', function() {
        var data = querystring.parse(postData);
        console.log('postData:' + postData);
        console.log(data);

        var s = '<p><a href="/" rel="external nofollow" rel="external nofollow" rel="external nofollow" rel="external nofollow" >back</a></p>\
            <p>username:'+data.username+'</p>\
            <p>password:'+data.password+'</p>\
            <p>age:'+data.age+'</p>';

        response.writeHead(200, {'content-type': 'text/html'});
        response.write(s);
        response.end();
    })
}

exports.show = show;